﻿using IT_RoadBlock.ViewModes;
using HandyControl.Controls;
using System.Windows;
using System.Windows.Controls;

namespace IT_RoadBlock.Controls
{
    public partial class ProjectInjectionUseControl : UserControl
    {
        public ProjectInjectionUseControl()
        {
            InitializeComponent();
            this.DataContext = new ProjectInjectionViewModel() {

                DialogWindow = (win, rs) => Dialog.Show(new TextDialog(win, rs)),
                OpenEditWindow = (it) =>
                {
                    ProjectInjectionEditWindow editWindow = new ProjectInjectionEditWindow(it??new Entities.TProjectInjectionInfo());
                    editWindow.ResizeMode = ResizeMode.NoResize;
                    editWindow.WindowStartupLocation =  WindowStartupLocation.CenterScreen;
                    editWindow.ShowDialog();
                }
            };
        }
    }
}
